<template>
	<view class="content">
		<headerbox :cixitype="cixi"></headerbox>
		<view class="pages">
			<view class="card card-style">
				<view class="contentTow" v-for="(item,index) in gonggaolist" :key="index">
					<view class="pb-0">{{item.title}}</view>
					<view class="pb-1">{{item.content}}</view>
				</view>
			</view>
		</view>
		<view class="footer-bar" :class="cixi ? '':'footer-bar-detached'">
			<view class="fbitem" @click="goSwichPage('/pages/index/index')">
				<view class="image">
					<image src="../../static/timg/shouye.png" mode=""></image>
				</view>
				<view class="text">首页</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/contract/contract')">
				<view class="image">
					<image src="../../static/timg/heyue.png" mode=""></image>
				</view>
				<view class="text">合约</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/assets')">
				<view class="image">
					<image src="../../static/timg/zichan.png" mode=""></image>
				</view>
				<view class="text">资产</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/claim')">
				<view class="image">
					<image src="../../static/timg/suopei.png" mode=""></image>
				</view>
				<view class="text">索赔</view>
			</view>
		</view>
	</view>
</template>

<script>
	import headerbox from '@/pages/header.vue'
	import { message } from '../../api/api.js'
	export default {
		components: {
			headerbox
		},
		data() {
			return {
				cixi: false,
				
				gonggaolist:[]
			}
		},
		onLoad() {
			if(uni.getStorageSync('token')){
				this.getgonggao()
			}
		},
		onPageScroll(e) {
			if (e.scrollTop > 0) {
				this.cixi = true
			} else {
				this.cixi = false
			}
		},
		methods: {
			getgonggao(){
				let datas = {
					page:1,
					type:1
				}
				message(datas).then(res => {
					if(res.data.status.errorCode == 0){
						this.gonggaolist = res.data.data.data
					}
				}).catch(err => {
					console.log(err)
				})
			},
			goSwichPage(page){
				uni.navigateTo({
					url:page
				})
			},
		}
	}
</script>
<style scoped>
	* {
		box-sizing: border-box;
	}

	.card {
		position: relative;
		display: flex;
		flex-direction: column;
		min-width: 0;
		word-wrap: break-word;
		background-color: #fff;
		background-clip: border-box;
		border: 1px solid rgba(0, 0, 0, 0.125);
		border-radius: 0.25rem;
	}

	.card-style {
		overflow: hidden;
		border-radius: 10px;
		margin: 0px 10px 15px 10px;
		border: none;
		box-shadow: rgb(0 0 0 / 30%) 0px 30px 60px -30px, rgb(10 37 64 / 35%) 0px -2px 6px 0px inset;
		background-size: cover;
		background-repeat: no-repeat;
		background-position: center center;
	}

	.contentTow {
		position: relative;
		margin: 20px 20px 20px 20px;
	}

	.pb-0 {
		font-size: 18px;
		line-height: 23px;
		font-weight: 700;
		color: #1b1b1b;
		font-family: "Nunito", sans-serif !important;
		margin-bottom: 5px;
		letter-spacing: -0.7px;
	}
	.pb-1 {
		color: #747474;
		margin-bottom: 30px;
		padding-bottom: 0px;
		letter-spacing: -0.2px;
		font-size: 14px;
		line-height: 25px;
	}
	.contentTow .pb-1:last-child {
		margin-bottom: 0px;
	}
</style>
<style scoped lang="scss">
	* {
		box-sizing: border-box;
	}

	.content {
		width: 100%;
		min-height: 100vh;
		background-color: #f1f1f7;
		color: #747474 !important;
	}

	.pages {
		padding-top: calc(calc(110rpx + 60rpx) + env(safe-area-inset-top));
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
	}
	.footer-bar{
		background-color: rgba(255, 255, 255, 0.95);
		padding: 0px 20rpx;
		position: fixed;
		bottom: 0px;
		left: 0px;
		right: 0px;
		z-index: 98;
		backdrop-filter: blur(20rpx);
		display: flex;
		text-align: center;
		transition: all 250ms ease;
		height: calc(120rpx + env(safe-area-inset-bottom));
		box-shadow: 0 -10rpx 10rpx 0 rgba(0, 0, 0, 0.04);
	}
	.footer-bar.footer-bar-detached{
		border-radius: 40rpx;
		left: 20rpx !important;
		right: 20rpx !important;
		bottom: 30rpx !important;
		box-shadow: 0 0px 30rpx 0 rgba(0, 0, 0, 0.1) !important;
		height: 120rpx !important;
	}
	.fbitem{
		color: #818181;
		position: relative;
		flex: 1 1 auto;
		padding-top: 24rpx;
		
		.image{
			height: 48rpx;
			margin-top: -4rpx;
			
			image{
				width: 36rpx;
				height: 36rpx;
			}
		}
		.text{
			height: 48rpx;
			margin-top: -6rpx;
			font-size: 24rpx;
			opacity: 0.7;
			color: #818181;
		}
	}
</style>